package unrepeatablereads;
import java.sql.*;

public class T1 {
	public static void main(String[] args) throws Exception {
		Connection connection = null;
		for(int i=0; i<18; i++){
			connection = DriverManager.getConnection("jdbc:pointbase:server://127.0.0.1/StaplerzDB", "PBPUBLIC", "PBPUBLIC");
			connection.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
			Statement query = connection.createStatement();

			ResultSet result = query.executeQuery("SELECT quantity FROM order_items WHERE sku='0001' AND orderid=1");
			while(result.next())
				System.out.println(result.getInt("quantity"));
			Thread.sleep(500);
		}
		
		connection.close();
	}
}
